%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for mutations/v4/enum_tables.mutations"
    Bucket0("Bucket 0 (root)"):::bucket
    Bucket1("Bucket 1 (mutationField)<br />Deps: 12, 51, 13<br /><br />1: PgDeleteSingle[9]<br />2: <br />ᐳ: Object[14]"):::bucket
    Bucket2("Bucket 2 (mutationField)<br />Deps: 22, 2<br /><br />1: Access[19]<br />2: Access[20]<br />3: Object[21]<br />4: PgInsertSingle[18]<br />5: <br />ᐳ: Object[23]"):::bucket
    Bucket3("Bucket 3 (mutationField)<br />Deps: 41, 2, 30<br /><br />1: Access[32]<br />2: Access[33]<br />3: Object[34]<br />4: PgFromExpression[35]<br />5: PgSelect[31]<br />6: PgSelectRows[37]<br />ᐳ: 36, 38, 39, 40"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 14, 9<br /><br />ROOT Object{1}ᐸ{result}ᐳ[14]"):::bucket
    Bucket5("Bucket 5 (nullableBoundary)<br />Deps: 23, 18<br /><br />ROOT Object{2}ᐸ{result}ᐳ[23]"):::bucket
    Bucket6("Bucket 6 (nullableBoundary)<br />Deps: 40, 39<br /><br />ROOT Object{3}ᐸ{result}ᐳ[40]"):::bucket
    Bucket7("Bucket 7 (nullableBoundary)<br />Deps: 9<br /><br />ROOT PgDeleteSingle{1}ᐸletter_descriptions(letter)ᐳ[9]"):::bucket
    Bucket8("Bucket 8 (nullableBoundary)<br />Deps: 18<br /><br />ROOT PgInsertSingle{2}ᐸletter_descriptions()ᐳ[18]"):::bucket
    end
    Bucket0 --> Bucket1 & Bucket2 & Bucket3
    Bucket1 --> Bucket4
    Bucket2 --> Bucket5
    Bucket3 --> Bucket6
    Bucket4 --> Bucket7
    Bucket5 --> Bucket8

    %% plan dependencies
    __InputObject25{{"__InputObject[25∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]<br />- Constantᐸ'a1'ᐳ[53]<br />- Constantᐸ'b2'ᐳ[54]<br />- Constantᐸ'c4'ᐳ[55]<br />- Constantᐸ'Qux'ᐳ[56]"}}:::plan
    __InputObject16{{"__InputObject[16∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]<br />- Constantᐸ'C'ᐳ[51]<br />- Constantᐸ'One does like to see the letter C'ᐳ[52]"}}:::plan
    __InputObject6{{"__InputObject[6∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]<br />- Constantᐸ'C'ᐳ[51]"}}:::plan
    Object12{{"Object[12∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access11{{"Access[11∈0] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access10 & Access11 --> Object12
    __InputObject15{{"__InputObject[15∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]"}}:::plan
    __InputObject16 --> __InputObject15
    __InputObject24{{"__InputObject[24∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]"}}:::plan
    __InputObject25 --> __InputObject24
    ApplyInput13{{"ApplyInput[13∈0] ➊"}}:::plan
    __InputObject6 --> ApplyInput13
    ApplyInput22{{"ApplyInput[22∈0] ➊"}}:::plan
    __InputObject15 --> ApplyInput22
    BakedInput30{{"BakedInput[30∈0] ➊"}}:::plan
    __InputObject25 --> BakedInput30
    ApplyInput41{{"ApplyInput[41∈0] ➊"}}:::plan
    __InputObject24 --> ApplyInput41
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ<br />Dependents: 6"]:::plan
    PgDeleteSingle9[["PgDeleteSingle[9∈1] ➊<br />ᐸletter_descriptions(letter)ᐳ<br />More deps:<br />- Constantᐸ'C'ᐳ[51]"]]:::sideeffectplan
    Object12 & ApplyInput13 --> PgDeleteSingle9
    Object14{{"Object[14∈1] ➊<br />ᐸ{result}ᐳ"}}:::plan
    PgDeleteSingle9 --> Object14
    PgInsertSingle18[["PgInsertSingle[18∈2] ➊<br />ᐸletter_descriptions()ᐳ"]]:::sideeffectplan
    Object21{{"Object[21∈2] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Object21 & ApplyInput22 --> PgInsertSingle18
    Access19{{"Access[19∈2] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access20{{"Access[20∈2] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access19 & Access20 --> Object21
    Object23{{"Object[23∈2] ➊<br />ᐸ{result}ᐳ"}}:::plan
    PgInsertSingle18 --> Object23
    PgSelect31[["PgSelect[31∈3] ➊<br />ᐸreferencing_table_mutation(mutation)ᐳ"]]:::sideeffectplan
    Object34{{"Object[34∈3] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgFromExpression35{{"PgFromExpression[35∈3] ➊"}}:::plan
    Object34 & PgFromExpression35 & ApplyInput41 --> PgSelect31
    Access32{{"Access[32∈3] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access33{{"Access[33∈3] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access32 & Access33 --> Object34
    BakedInput30 --> PgFromExpression35
    First36{{"First[36∈3] ➊"}}:::plan
    PgSelectRows37[["PgSelectRows[37∈3] ➊"]]:::plan
    PgSelectRows37 --> First36
    PgSelect31 --> PgSelectRows37
    PgSelectSingle38{{"PgSelectSingle[38∈3] ➊<br />ᐸreferencing_table_mutationᐳ"}}:::plan
    First36 --> PgSelectSingle38
    PgClassExpression39{{"PgClassExpression[39∈3] ➊<br />ᐸ__referenc...tation__.vᐳ"}}:::plan
    PgSelectSingle38 --> PgClassExpression39
    Object40{{"Object[40∈3] ➊<br />ᐸ{result}ᐳ"}}:::plan
    PgClassExpression39 --> Object40
    PgClassExpression42{{"PgClassExpression[42∈7] ➊<br />ᐸ__letter_d...ons__.”id”ᐳ"}}:::plan
    Access43{{"Access[43∈7] ➊<br />ᐸ9.tᐳ"}}:::plan
    Access43 --> PgClassExpression42
    PgDeleteSingle9 --> Access43
    PgClassExpression46{{"PgClassExpression[46∈7] ➊<br />ᐸ__letter_d..._.”letter”ᐳ"}}:::plan
    PgClassExpression42 o--o PgClassExpression46
    PgClassExpression48{{"PgClassExpression[48∈7] ➊<br />ᐸ__letter_d..._via_view”ᐳ"}}:::plan
    PgClassExpression46 o--o PgClassExpression48
    PgClassExpression44{{"PgClassExpression[44∈8] ➊<br />ᐸ__letter_d...ons__.”id”ᐳ"}}:::plan
    Access45{{"Access[45∈8] ➊<br />ᐸ18.tᐳ"}}:::plan
    Access45 --> PgClassExpression44
    PgInsertSingle18 --> Access45
    PgClassExpression47{{"PgClassExpression[47∈8] ➊<br />ᐸ__letter_d..._.”letter”ᐳ"}}:::plan
    PgClassExpression44 o--o PgClassExpression47
    PgClassExpression49{{"PgClassExpression[49∈8] ➊<br />ᐸ__letter_d..._via_view”ᐳ"}}:::plan
    PgClassExpression47 o--o PgClassExpression49
    PgClassExpression50{{"PgClassExpression[50∈8] ➊<br />ᐸ__letter_d...scription”ᐳ"}}:::plan
    PgClassExpression49 o--o PgClassExpression50

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,__InputObject6,Access10,Access11,Object12,ApplyInput13,__InputObject15,__InputObject16,ApplyInput22,__InputObject24,__InputObject25,BakedInput30,ApplyInput41 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgDeleteSingle9,Object14 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,PgInsertSingle18,Access19,Access20,Object21,Object23 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3,PgSelect31,Access32,Access33,Object34,PgFromExpression35,First36,PgSelectRows37,PgSelectSingle38,PgClassExpression39,Object40 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgClassExpression42,Access43,PgClassExpression46,PgClassExpression48 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8,PgClassExpression44,Access45,PgClassExpression47,PgClassExpression49,PgClassExpression50 bucket8

